package com.flute.icrawler.config;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.flute.icrawler.app.util.XStreamUtil;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

public class ExtractorBelongingsAlgoConfig implements Serializable {

	private static final long serialVersionUID = -4404384056193730046L;
	private List<ExtractorBelongingsAlgo> extractorBelongingsAlgos = new ArrayList<ExtractorBelongingsAlgo>();

	public List<ExtractorBelongingsAlgo> getExtractorBelongingsAlgos() {
		return extractorBelongingsAlgos;
	}

	public void setExtractorBelongingsAlgos(
			List<ExtractorBelongingsAlgo> extractorBelongingsAlgos) {
		this.extractorBelongingsAlgos = extractorBelongingsAlgos;
	}

	public void addExtractorBelongingsAlgos(ExtractorBelongingsAlgo algo) {
		this.extractorBelongingsAlgos.add(algo);
	}

	public String toXML() {
		XStream xstream = new XStream(new DomDriver());
		return xstream.toXML(this);
	}

	public static void main(String[] args) {
		ExtractorBelongingsAlgoConfig config = (ExtractorBelongingsAlgoConfig) XStreamUtil
				.newObject("f://ExtractorBelongingsAlgoConfig.xml");
		System.out.println(config.toXML());

	}

}
